export const check = () => {
    let pages = getCurrentPages()
    let currentUrl = pages[pages.length - 1].route
    let white_list = [
        'pages/main/main',
        'pages/message/message',
        'pages/release/release',
        'pages/recruit/recruit',
        'pages/resell/resell',
        'pages/supply/supply',
        'pages/recruit-detail/recruit-detail',
        'pages/resell-detail/resell-detail',
        'pages/supply-detail/supply-detail',
        'pages/welfare-list/welfare-list',
        'pages/welfare-detail/welfare-detail',
        'pages/register/register',
        'pages/forget/forget'
    ]

    if (!wx.getStorageSync('userInfo') && !white_list.includes(currentUrl.toString())) {
        wx.showToast({title: '请先登录', icon: 'none', duration: 1000, mask: true});
        setTimeout(()=>{
            wx.navigateTo({
                url: '/pages/login/login'
            })
        },500)
        return false
    }else {
        return true
    }
}